// pages/card/card.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navList: [{
        title: '充值管理',
        showIndex: true,
        class: 'yellow',
        icon: '/images/yellow_right.png',
        inner: [{
          navName: '水卡充值',
          url: '../fastCardApply/fastCardApply?from=2'
        }, {
          navName: '批量充值',
          url: '/pages/partner/cardList/cardAdd?type=3'
        }, {
          navName: '充值记录',
          url: '/pages/partner/rechargeRecord/rechargeRecord?is_promoter=1'
        }],
      },
      {
        title: '普通水卡管理',
        showIndex: true,
        class: 'blue',
        icon: '/images/blue_right.png',
        inner: [{
            navName: '我的水卡',
            url: '../fictitiousCard/fictitiousCard'
          }, {
            navName: '水卡开卡',
            url: '../fastCardApply/fastCardApply?from=1'
          }, {
            navName: '批量开卡',
            url: '/pages/partner/cardList/cardAdd?type=2'
          }, {
            navName: '水卡开卡记录',
            url: '../applyList/applyList'
          },
          // { navName: '线上申请实体卡审核', url: '../examineOnline/examineOnline'},
        ]
      }
    ],
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    wx.removeStorageSync('village')
  },


  // 展开折叠选择  
  panel: function (e) {
    var that = this;
    var i = e.currentTarget.dataset.index
    var nv = that.data.navList;
    if (nv[i].showIndex == false) {
      nv[i].showIndex = true
    } else {
      nv[i].showIndex = false
    }
    that.setData({
      navList: nv
    })
  }
})